package BoostedTest::RDBO::Component;

use strict;

use base qw(BoostedTest::RDBO::DB::Object);

__PACKAGE__->meta->setup(
    table   => 'components',

    columns => [
        id          => { type => 'serial', not_null => 1 },
        name        => { type => 'varchar', length => 255 },
        description => { type => 'varchar', length => 255 },
    ],

    relationships => [
        projects =>
        {
          type      => 'many to many',
          map_class => 'BoostedTest::RDBO::ProjectsHasComponent',
          map_from  => 'component',
          map_to    => 'project',
        },

        testplans =>
        {
          type      => 'many to many',
          map_class => 'BoostedTest::RDBO::ComponentsHasTestplan',
          map_from  => 'component',
          map_to    => 'testplan',
        }
      ],

    primary_key_columns => [ 'id' ],
);

1;

